home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 April: Mac OS SDK / Dev.CD Apr 96 SDK / Dev.CD Apr 96 SDK1.toast / Development Kits (Disc 1) / OpenDoc Development Framework / ODFDev / ODF / Examples / Movie / Include / MoviePar.h < prev    next >
Encoding:
Text File  |  1995-11-08  |  4.5 KB  |  142 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                MoviePar.h
  4. //    Release Version:    $ 1.0d11 $
  5. //
  6. //    Copyright:    © 1993, 1995 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef MOVIEPAR_H
  11. #define MOVIEPAR_H
  12.  
  13. #ifndef MOVIEDEF_H
  14. #include "MovieDef.h"
  15. #endif
  16.  
  17. #ifndef FWPART_H
  18. #include "FWPart.h"
  19. #endif
  20.  
  21. // ----- OS Layer -----
  22.  
  23. #ifndef FWMENU_H
  24. #include <FWMenu.h>
  25. #endif
  26.  
  27. #ifndef FWPICTUR_H
  28. #include "FWPictur.h"
  29. #endif
  30.  
  31. //========================================================================================
  32. // Forward declarations
  33. //========================================================================================
  34.  
  35. #if FW_LIB_EXPORT_PRAGMAS
  36. #pragma lib_export on
  37. #endif
  38. class FW_CLASS_ATTR FW_CMenuEvent;
  39. class FW_CLASS_ATTR FW_CNullEvent;
  40. class FW_CLASS_ATTR FW_CFileSpecification;
  41. class FW_CLASS_ATTR FW_CMenuBar;
  42. class FW_CLASS_ATTR FW_CFrame;
  43. class FW_CLASS_ATTR CMovie;
  44. #if FW_LIB_EXPORT_PRAGMAS
  45. #pragma lib_export off
  46. #endif
  47.  
  48.  
  49. //========================================================================================
  50. //    Constants
  51. //========================================================================================
  52.  
  53. const ODCommandID cChooseMovie = FW_kFirstUserCommandID;
  54. const ODCommandID cStartStopMovie = cChooseMovie + 1;
  55. const ODCommandID cSetMovieLooping = cStartStopMovie + 1;
  56. const ODCommandID cShowMovieController = cSetMovieLooping + 1;
  57.  
  58. //========================================================================================
  59. //    CLASS CMoviePart
  60. //========================================================================================
  61.  
  62. class FW_CLASS_ATTR CMoviePart : public FW_CPart
  63. {
  64. public:
  65.     static const ODValueType kPartKind;
  66.     static const ODValueType kPartUserName;
  67.  
  68. //----------------------------------------------------------------------------------------
  69. //    Initialization/Destruction
  70. //
  71. public:
  72.     CMoviePart(ODPart* odPart);
  73.     virtual ~CMoviePart();
  74.     
  75.     virtual void Initialize(Environment* ev);
  76.         
  77. //----------------------------------------------------------------------------------------
  78. //    Inherited API
  79. //
  80. public:
  81.     virtual void             InternalizeContent(Environment* ev, ODStorageUnit* storageUnit, FW_CCloneInfo* cloneInfo);
  82.     virtual void             ExternalizeContent(Environment* ev, ODStorageUnit* storageUnit, FW_CCloneInfo* cloneInfo);
  83.     virtual FW_CFrame*         NewFrame(Environment* ev,
  84.                                     ODFrame* odFrame, 
  85.                                     FW_CPresentation* presentation,
  86.                                     FW_Boolean fromStorage);
  87.  
  88.     virtual FW_Boolean        DoIdle(Environment* ev, const FW_CNullEvent& theNullEvent);
  89.     virtual FW_Boolean        DoMenu(Environment* ev, const FW_CMenuEvent& theMenuEvent);
  90.     
  91. //----------------------------------------------------------------------------------------
  92. //    New API
  93. //
  94.     FW_PPicture             GetDefaultPicture(Environment *ev) const;
  95.     FW_Boolean                 IsLooping(Environment *ev) const;
  96.     FW_Boolean                 IsControllerShown(Environment *ev) const;
  97.     CMovie*                 GetInternalizedMovie(Environment *ev) const;
  98.     
  99.     
  100.     void                    InternalizeODFMovie(Environment* ev, ODStorageUnit* storageUnit);
  101.     void                    InternalizeMovieFile(Environment* ev, ODStorageUnit* storageUnit);
  102.  
  103. protected:
  104.     FW_Boolean    GetMovieFileFromUser(Environment* ev, FW_CFileSpecification& fileSpec) const;
  105.     
  106.     void ChooseMovie(Environment* ev);
  107.     void ToggleLooping(Environment* ev);
  108.     void ToggleController(Environment* ev);
  109.     
  110. private:
  111.     FW_PPicture         fDefaultPicture;
  112.     FW_Boolean             fLooping;
  113.     FW_Boolean             fShowController;
  114.     FW_CPresentation*    fPresentation;
  115.     CMovie*                fInternalizedMovie;        // Temporary cache for internalized movies
  116. };
  117.  
  118. //----------------------------------------------------------------------------------------
  119. // CMoviePart::IsLooping
  120. //----------------------------------------------------------------------------------------
  121. inline FW_Boolean CMoviePart::IsLooping(Environment *ev) const
  122. {
  123.     return fLooping;
  124. }
  125.  
  126. //----------------------------------------------------------------------------------------
  127. // CMoviePart::IsControllerShown
  128. //----------------------------------------------------------------------------------------
  129. inline FW_Boolean CMoviePart::IsControllerShown(Environment *ev) const
  130. {
  131.     return fShowController;
  132. }
  133.  
  134. //----------------------------------------------------------------------------------------
  135. // CMoviePart::GetInternalizedMovie
  136. //----------------------------------------------------------------------------------------
  137. inline CMovie* CMoviePart::GetInternalizedMovie(Environment *ev) const
  138. {
  139.     return fInternalizedMovie;
  140. }
  141.  
  142. #endif